#include<stdio.h>
#include<signal.h>
#include<unistd.h>

void sig_alrm(int signo);

int main(int argc,char **argv)
{
	int       n;
	char      line[10];

	if(signal(SIGALRM,sig_alrm) ==SIG_ERR)
	{
		printf("signal(SIGALRM) error\n");
	}

	alarm(120);
	if((n = read(STDIN_FILENO,line,10)) < 0)
	{
		printf("read error\n");
	}

	alarm(0);
	write(STDOUT_FILENO,line,n);

	printf("测试https协议\n");
	return 0;
}

void sig_alrm(int signo)
{
	printf("%d signal received\n",signo);
	
    
}
